<?php

class Admin_Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    protected $_name = "admin";

    public function _initAcl() {
        // ACL
        $registry = Zend_Registry::getInstance();
        $acl = $registry->get('acl');
        $this->_initIndexAcl($acl);
    }

    /**
     * ACL for IndexController
     * @param type $acl is ACL
     */
    private function _initIndexAcl($acl) {
        // Resources
        $resource = $this->_name . ':index';
        $acl->addResource($resource);
        
        // Roles
        $guest = array(
            'index'
        );
        $user = array(
        );
        $acl->allow(Core_Role::ROLE_GUEST, $resource, $guest);
        $acl->allow(Core_Role::ROLE_USER, $resource, $user);
    }

}